package cn.kais.drawer.bean;

import java.awt.*;

/**
 * 测试使用，绘制组件边框
 */
public class BeanBorder extends BeanBasic {

    public int top;
    public int left;
    public int width;
    public int height;

    public int lineWidth = 1; // 线宽

    public Graphics2D sd; // 绘制

    public BeanBorder(Graphics2D sd, int top, int left, int width, int height) {
        this.sd = sd;
        this.top = top;
        this.left = left;
        this.width = width;
        this.height = height;

        this.create();
    }

    private void create() {
        sd.setColor(Color.blue);
        BasicStroke stroke = new BasicStroke(this.lineWidth);
        sd.setStroke(stroke);
        sd.drawRect(this.left, this.top, this.width, this.height);
    }

}